<template>
  <div class="stock-task-list" ref="content">
    <div class="operate">
      <a-button type="dashed" style="width: 100%" icon="plus" @click="$refs.taskForm.add()">添加</a-button>
    </div>
    <a-list
      :data-source="taskData"
      :grid="{ gutter: 24, xl: 4, lg: 3, md: 2, sm: 2, xs: 1 }"
      style="margin-top: 24px;"
    >
      <a-list-item slot="renderItem" slot-scope="item">
        <task-card :data="item"></task-card>
      </a-list-item>
    </a-list>
    <task-form ref="taskForm" />
  </div>
</template>

<script>
import TaskCard from './components/TaskCard'
import TaskForm from './components/TaskForm'
export default {
  components: { TaskCard, TaskForm },
  data () {
    return {
      taskData: [
        {
          id: 1,
          task_name: '11111',
          thumb: 'https://gw.alipayobjects.com/zos/rmsportal/zOsKZmFRdUtvpqCImOVY.png',
          task_num: '12312321',
          match: {
            success: 10,
            success_percent: 64.4,
            fail: 2,
            fail_percent: 35.6
          },
          chartData: [{ type: '盈利', amount: 21393.55 }, { type: '亏损', amount: 3530.34 }]
        }
      ]
    }
  },
  mounted () {},
  methods: {}
}
</script>

<style  lang="less" scoped>
</style>
